#include "stm32f10x.h"                  // Device header
#include "bsp_Led.h"
#include "usart.h"
#include "delay.h"
#include "HC_05.h"

int main(){
	SystemInit();//配置系统时钟为72M，加不加这行代码都是默认72M，但是可以去这个函数里面修改M
	delay_init(72);
	USART1_Config();
	LED_CPIO_Init();
	USART2_Init(9600);
	while(1){
		if(RxData == 0x00) {
			LED_G(OFF);  //关灯
			delay_ms(10);
			printf("\r\n灯关闭了\r\n");
		}
		else if(RxData == 0x01) {
			LED_G(ON);   //开灯
			delay_ms(10);
			Usart_SendString(USART1,"\r\n灯打开了\r\n");
		}
	}
}
